package org.hr.xtime.user

import org.hr.organisation.OrganisationService;
import org.hr.organisation.UserDetails;

class Employee {

	String userId
	String standIn

	OrganisationService organisationService

	static transients=['organisationService']
    static constraints = {
		userId (nullable:false)
		standIn (nullable:false)
    }
	
	
	String toString(){
		UserDetails user = organisationService.getUserDetails(userId)
		if(!user) return userId
		else return "${user.firstname} ${user.lastname} (${userId})"
	}
	
}
